From 9e5682a891ab73287139163ac9f444e09d6d2278 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Sun, 7 Sep 2008 16:46:59 +0000 Subject: [PATCH] waypt: Add function 'waypt_disp_session'. --- waypt.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/waypt.c b/waypt.c index 7ff60bf27..065f388dd 100644 --- a/waypt.c +++ b/waypt.c @@ -244,21 +244,7 @@ waypt_status_disp(int total_ct, int myct) void waypt_disp_all(waypt_cb cb) { - queue *elem, *tmp; - waypoint *waypointp; - int i = 0; - - QUEUE_FOR_EACH(&waypt_head, elem, tmp) { - waypointp = (waypoint *) elem; - if (global_opts.verbose_status) { - i++; - waypt_status_disp(waypt_ct, i); - } - (*cb) (waypointp); - } - if (global_opts.verbose_status) { - fprintf(stdout, "\r\n"); - } + waypt_disp_session(NULL, cb); } void @@ -270,7 +256,7 @@ waypt_disp_session(const session_t *se, waypt_cb cb) QUEUE_FOR_EACH(&waypt_head, elem, tmp) { waypointp = (waypoint *) elem; - if (waypointp->session == se) { + if ((se == NULL) || (waypointp->session == se)) { if (global_opts.verbose_status) { i++; waypt_status_disp(waypt_ct, i); -- 2.30.2